package com.sokal.easycare.modules.picture.entity;

import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sokal.easycare.common.config.Global;
import com.sokal.easycare.common.persistence.DataEntity;

/**
 * 图文内容Entity
 * 
 * @author liliangdong
 * @version 2017-03-22
 */
public class PicArticleFile extends DataEntity<PicArticleFile> {

	private static final long serialVersionUID = 1L;
	private PicArticle picArticle; // 所属图文 父类
	private String fileName; // 名称
	private String fileUrl; // 路径
	private String fileType; // 文件类型 0普通 1单图 2多图
	private String sort; // 排序

	private String fastdfs_file_url;

	public PicArticleFile() {
		super();
		this.fastdfs_file_url = Global.getConfig("fastdfs_file_url");
	}

	public PicArticleFile(String id) {
		super(id);
		this.fastdfs_file_url = Global.getConfig("fastdfs_file_url");
	}

	public PicArticleFile(PicArticle picArticle) {
		this.picArticle = picArticle;
	}

	@JsonIgnore
	@Length(min = 0, max = 64, message = "所属图文长度必须介于 0 和 64 之间")
	public PicArticle getPicArticle() {
		return picArticle;
	}

	public void setPicArticle(PicArticle picArticle) {
		this.picArticle = picArticle;
	}

	@Length(min = 0, max = 100, message = "名称长度必须介于 0 和 100 之间")
	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	@Length(min = 0, max = 255, message = "路径长度必须介于 0 和 255 之间")
	public String getFileUrl() {
		return fileUrl;
	}

	public void setFileUrl(String fileUrl) {
		this.fileUrl = fileUrl;
	}

	@Length(min = 0, max = 2, message = "文件类型 0普通 1单图 2多图长度必须介于 0 和 2 之间")
	public String getFileType() {
		return fileType;
	}

	public void setFileType(String fileType) {
		this.fileType = fileType;
	}

	@Length(min = 0, max = 11, message = "排序长度必须介于 0 和 11 之间")
	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}

	public String getFastdfs_file_url() {
		return fastdfs_file_url;
	}

	public void setFastdfs_file_url(String fastdfs_file_url) {
		this.fastdfs_file_url = Global.getConfig("fastdfs_file_url");
	}

}